﻿@{
    ViewBag.Title = "ResChart";
    //http://www.chartjs.org/docs/
 
}

<div class="container" style="margin-top: 20px;">
    <div class="panel panel-default">
        <div class="panel-heading">
            近一年上传资源数量
        </div>
        <div class="panel-body">
            <canvas id="rescate_chart" width="600" height="400"></canvas>
        </div>
    </div>

</div>
@section css{
    <style>
      
    </style>
}

@section script
{
    <script src="~/Scripts/chart/Chart.js"></script>

    <!--[if lte IE 8]>
        <script src="~/Scripts/chart/excanvas.ie8.js"></script>
	<![endif]-->

    <script type="text/javascript">
        $(function () {
            function init(parameters) {
                $("#rescate_chart").attr("width",$("#rescate_chart").parent().width() - 20);

                var data = {
                    labels: @Html.Raw(ViewBag.CHART_LABELS),
                    datasets: [
                        {
                            fillColor: "rgba(220,220,220,0.5)",
                            strokeColor: "rgba(220,220,220,1)",
                            pointColor: "rgba(220,220,220,1)",
                            pointStrokeColor: "#fff",
                            data:  @Html.Raw(ViewBag.CHART_VALUES)
                            }
                    ]
                }

                    var ctx = document.getElementById("rescate_chart").getContext("2d");
                    var myNewChart = new Chart(ctx).Line(data, { animationSteps: 5, scaleFontFamily: "microsoft yahei" });

                  
                }

            init();
        });
    </script>
}
